<?php
/**
 * The Sidebar containing the main widget area.
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?>

<div id="secondary" class="widget-area blog-sidebar" role="complementary">
	<ul class="xoxo">
	<?php if ( ! dynamic_sidebar( 'sidebar-blog' ) ) : ?>
		<li id="archives" class="widget-container">
			<h3 class="blog-archive-posts cufon"><?php _e( 'Topics', 'twentyten' ); ?></h3>
			<ul>
				
				<?php 
					$args = array(
						'post_type' => 'singcrets-blog',
						'orderby' => 'date',
						'order' => 'ASC',
						'posts_per_page' => '5'
					);

					// and now store that custom query
					$cpt_query = new WP_Query( $args );

					// and finally, run the custom loop
					if ( $cpt_query->have_posts() ) : while ( $cpt_query->have_posts() ) : $cpt_query->the_post(); 
						echo '<li><a href="' .  get_permalink($post->ID) . '">' . get_the_title() . '</a></li>';
					endwhile;endif;
					// use whatever standard template tags...
				?>
				
			</ul>
		</li>

		<li id="instagram" class="widget-container">
			<a href="#">We just post on Instagram</a>
		</li>


	<?php endif; // end sidebar widget area ?>
	</ul>
</div><!-- #secondary .widget-area -->